package com.ruoyi.enterprise.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.enterprise.mapper.ComHotMapper;
import com.ruoyi.enterprise.domain.ComHot;
import com.ruoyi.enterprise.service.IComHotService;

/**
 * 热门股票Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-03-01
 */
@Service
public class ComHotServiceImpl implements IComHotService 
{
    @Autowired
    private ComHotMapper comHotMapper;

    /**
     * 查询热门股票
     * 
     * @param id 热门股票主键
     * @return 热门股票
     */
    @Override
    public ComHot selectComHotById(Long id)
    {
        return comHotMapper.selectComHotById(id);
    }

    /**
     * 查询热门股票列表
     * 
     * @param comHot 热门股票
     * @return 热门股票
     */
    @Override
    public List<ComHot> selectComHotList(ComHot comHot)
    {
        return comHotMapper.selectComHotList(comHot);
    }

    /**
     * 新增热门股票
     * 
     * @param comHot 热门股票
     * @return 结果
     */
    @Override
    public int insertComHot(ComHot comHot)
    {
        comHot.setCreateTime(DateUtils.getNowDate());
        return comHotMapper.insertComHot(comHot);
    }

    /**
     * 修改热门股票
     * 
     * @param comHot 热门股票
     * @return 结果
     */
    @Override
    public int updateComHot(ComHot comHot)
    {
        comHot.setUpdateTime(DateUtils.getNowDate());
        return comHotMapper.updateComHot(comHot);
    }

    /**
     * 批量删除热门股票
     * 
     * @param ids 需要删除的热门股票主键
     * @return 结果
     */
    @Override
    public int deleteComHotByIds(Long[] ids)
    {
        return comHotMapper.deleteComHotByIds(ids);
    }

    /**
     * 删除热门股票信息
     * 
     * @param id 热门股票主键
     * @return 结果
     */
    @Override
    public int deleteComHotById(Long id)
    {
        return comHotMapper.deleteComHotById(id);
    }
}
